BIN=code.exe
#SRC=$(shell ls *.c)
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
RM=rm -f
LFLAGS=-o
FLAGS=-c
CC=gcc

$(BIN):$(OBJ)
	@$(CC) $^ $(LFLAGS) $@
	@echo "linking...$^...to$@"
%.o:%.c
	$(CC) $(FLAGS) $<
	@echo "compeling...$<...to$@"
#$(OBJ):$(SRC)
#	$(CC) $(FLAGS) $^ 
#	@echo "compling...$^...to$@"

.PHONY:clean
clean:
	@$(RM) $(OBJ) $(BIN)
	@echo "removing $(OBJ) and $(BIN)"

.PHONY:test
test:
	@echo "$(BIN)"
	@echo "$(SRC)"
	@echo "$(OBJ)"
	@echo "$(RM)"
	@echo "$(LFLAGS)"
	@echo "$(FLAGS)"
	@echo "$(CC)"
